/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package thienphuc.patient.bo.impl;

import java.util.List;
import thienphuc.patient.bo.NhomThuocBO;
import thienphuc.patient.dao.NhomThuocDAO;
import thienphuc.patient.dao.impl.NhomThuocDAOImpl;
import thienphuc.patient.dto.NhomThuoc;

/**
 *
 * @author QuocDat
 */
public class NhomThuocBOImpl implements NhomThuocBO {

    private NhomThuocDAO nhomThuocDAO;

    public NhomThuocBOImpl() {
        this.nhomThuocDAO = new NhomThuocDAOImpl(NhomThuoc.class);
    }
    
    public List<NhomThuoc> getAll() throws Exception {
        return this.nhomThuocDAO.findAll();
    }

    public NhomThuoc getById(int maNhom) throws Exception {
        return this.nhomThuocDAO.findById(maNhom);
    }

    public List<NhomThuoc> getByTenNhom(String tenNhom) throws Exception {
        return this.nhomThuocDAO.findByTenNhom(tenNhom);
    }

    public List<NhomThuoc> getByTrangThai(boolean trangThai) throws Exception {
        return this.nhomThuocDAO.findByTrangThai(trangThai);
    }

    public boolean insertNhomThuoc(NhomThuoc nhomThuoc) throws Exception {
        return this.nhomThuocDAO.save(nhomThuoc);
    }

    public boolean updateNhomThuoc(NhomThuoc nhomThuoc) throws Exception {
        return this.nhomThuocDAO.update(nhomThuoc);
    }
    
}
